cmake_minimum_required (VERSION 2.6)
project (cubefs-core-java)

include (../../../core/build/platforms/posix/cubefs-core.cmake)
include (../../../core/build/platforms/all/cubefs-core-meta.cmake)

set (CMAKE_CXX_FLAGS -fno-rtti)
SET(PROJECT_BINARY_DIR build)

set (CMAKE_USE_RELATIVE_PATHS OFF)

include_directories(../../../core/include . )
include_directories(../../../core/api)


try_run(ARCH64 CVAR  ${CMAKE_BINARY_DIR}  ${CMAKE_SOURCE_DIR}/checks/arch.c)


file(GLOB SRC_LIST *.cpp)

#set (SRC_LIST natives.cpp field_metadata.cpp factory.cpp type.cpp types.cpp type_system.cpp typed.cpp iterator.cpp)

if (ARCH64)
    add_library(cubefs-core-java.x86_64 SHARED ${SRC_LIST})
    target_link_libraries(cubefs-core-java.x86_64 cubefs cubefs-meta)
else (ARCH64)
    add_library(cubefs-core-java.x86_32 SHARED ${SRC_LIST})
    target_link_libraries(cubefs-core-java.x86_32 cubefs)
endif (ARCH64)
